package com.ysd.crm.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import lombok.Data;

@Table
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
public class Users {
	@NotNull
	@javax.persistence.Id
    private String Id;//编号
	@NotNull
	@Column(name = "LoginName",unique = true)
    private String LoginName;//登录名
	@NotNull
	private String Password;//密码
	@Column(name = "IsLockout",columnDefinition = "varchar(10) default '否'")
	private String IsLockout;//是否锁定
	private Date LastLoginTime;
	@Column(name = "PsdWrongTime",columnDefinition = "tinyint default 0")
	private int PsdWrongTime;//密码错误次数
	private Date LockTime;//被锁定时间
	private String ProtectEMail;//密保邮箱
	private String protectMTel;//密保手机号
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@CreatedDate
	private Date CreateTime;//账号创建时间
}
